//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 
// 	FILE:		meshes.h
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#ifndef MESHES_H
#define MESHES_H


//-- INCLUDES -----------------------------------------------------------------------------------------------------------
#include <OpenMesh/Core/Geometry/VectorT.hh>
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/IO/Options.hh>
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
#include <QtOpenGL/qgl.h>
using namespace OpenMesh;
#include "transformObject.h"


//-- CONSTANTS, TYPEDEFS AND STRUCTS------------------------------------------------------------------------------------
#define HIDDEN_LINE 1
#define FLAT		2
#define SMOOTH		3
#define POINTS		4
#define WIRE		5

// Include "previous edge" in half edge data structure
struct MyTraits : public OpenMesh::DefaultTraits
{
	HalfedgeAttributes( OpenMesh::Attributes::PrevHalfedge );
};

typedef TriMesh_ArrayKernelT<MyTraits>  TriMesh;
typedef PolyMesh_ArrayKernelT<MyTraits> PolyMesh;


//-- CLASS DECLARATION --------------------------------------------------------------------------------------------------
class Mesh: public TransformObject
{	

 public:
	 Mesh ( );				/* default constructor */ 
	~Mesh( ){ }				/* default destructor  */

	PolyMesh		mesh;

	//-- PUBLIC MEMBERS AND FUNCTIONS ------------------------------------------------------------
	
	void draw		( const unsigned int _drawmode );
	bool openMesh	( const char * _filename );
	void setMaterial( );

protected:
	void drawMesh	( const unsigned int _drawmode );
	void drawFaces	( const unsigned int _drawmode );

	//-- PRIVATE DATA MEMBERS FUNCTIONS ------------------------------------------------------

private:
	
	QString			meshFilename;
};

#endif